﻿using System.Linq;
using MDT.LifeSewagePlatform.Entity;
using MDT.LifeSewagePlatform.IRepository;
using Microsoft.EntityFrameworkCore;

namespace MDT.LifeSewagePlatform.Repository
{
    public class SetAlarmRepository: BaseRepository<SetAlarmEntity>,ISetAlarmRepository
    {
        public SetAlarmRepository()
        {
        }

        public IQueryable<SetAlarmView> GetSetAlarms()
        {
            var query = from set in _dbContext.SetAlarm.AsNoTracking()
                        select new SetAlarmView()
                        {
                            MoreOnceYellowID = set.MoreOnceYellowID,
                            MoreOneceRedID = set.MoreOneceRedID,
                            MoreRedID = set.MoreRedID,
                            MoreYellowID = set.MoreYellowID,
                            ID = set.ID,
                            IsUserMore = set.IsUserMore,
                            IsUserOnce = set.IsUserOnce,
                            VerifyTypeID = set.VerifyTypeID
                        };
            return query;
        }
    }
}
